package com.pwc.conversionTool.biz;

import com.pwc.conversionTool.dao.AccountDao;
import com.pwc.conversionTool.entity.Account;

public class AccountBiz {
	private AccountDao dao=new AccountDao();
	
	public boolean register(Account account)
	{
		
		Account accountSearch=dao.getAccountByEmail(account.getEmail());
		
		if(accountSearch==null)
		{
			dao.saveAccount(account);
			return true;
		}else {
			return false;
		}
		
	}
	
	public boolean Login(Account account)
	{
		Account accountSearch=dao.getAccountByEmail(account.getEmail());
		
		if(accountSearch!=null)
		{			
			if(accountSearch.getPassword().equals(account.getPassword()))
			{
				return true;
			}
		}
		
		return false;
	}
	
	
	

}
